package org.gcb.core.ui.model;

import javax.swing.DefaultBoundedRangeModel;
import org.gcb.core.model.Toon;

/**
 *
 * @author Jason
 */
public class ExperienceProgressModel extends DefaultBoundedRangeModel{
    private final Toon toon;
    public ExperienceProgressModel(Toon toon) {
        this.toon = toon;
    }

    @Override
    public int getExtent() {
        return super.getExtent();
    }

    @Override
    public int getMaximum() {
        //TODO do calculations based on current level as to what the toon needs to gain to obtain the next level. for now, always at 100
        return 100;
    }

    @Override
    public int getMinimum() {
        //TODO need to decide how to handle (always at 0 or starting where last level max was) for now, always at 0
        return 0;
    }

    @Override
    public int getValue() {
        return toon.getExperience();
    }

    @Override
    public boolean getValueIsAdjusting() {
        //TODO this can be useful if in the 'process' of leveling a toon
        return super.getValueIsAdjusting();
    }

    @Override
    public void setRangeProperties(int newValue, int newExtent, int newMin, int newMax, boolean adjusting) {
        super.setRangeProperties(newValue, newExtent, newMin, newMax, adjusting);
    }
    
}
